<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('nickname')->nullable()->comment("微信昵称");
            $table->string('avatar')->nullable()->comment("微信头像");
            $table->string('name')->nullable()->comment("姓名");
            $table->string('mobile')->default(0.00)->comment("手机号");
            $table->decimal('money')->default(0.00)->comment("充值余额");
            $table->decimal('amount')->nullable()->comment("分销金额");
            $table->decimal('used_amount')->nullable()->comment("已提现金额");
            $table->integer('tid')->default(0)->comment("推荐用户ID");
            $table->tinyInteger('status')->default(0)->comment("状态:0=启用,1=禁用");
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
